/*
 * Copyright 2011 Andy Lee.
 * 
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
 * use this file except in compliance with the License. You may obtain a copy of
 * the License at
 * 
 * http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations under
 * the License.
 */
package uk.co.optimisticpanda.remoteweb.command

import java.util.List;

import uk.co.optimisticpanda.remoteweb.command.Command;
import uk.co.optimisticpanda.remoteweb.command.Executable;

class SampleCommands {

	def coms6 = [
		new Command(description : "coms6Task1", executable: new Executable(closure:  {println "exec s1a" })),
		new Command(description : "coms6Task2", executable: new Executable(closure:  {println "exec s3a" })),
		new Command(description : "coms6Task3", executable: new Executable(closure:  {println "exec s3a" })),
	]
	def coms5 = [
		new Command(description : "coms5Task1", executable: new Executable(closure:  {println "exec s1a" })),
		new Command(description : "coms5Parent", children : coms6),
		new Command(description : "coms5Task2", executable: new Executable(closure:  {println "exec s3a" })),
	]

	def coms4 = [
		new Command(description : "subSubTask1", executable: new Executable(closure:  {println "exec s1b" })),
		new Command(description : "subSubTask2", executable: new Executable(closure:  {println "exec s2b" })),
		new Command(description : "subSubTask3", executable: new Executable(closure:  {println "exec s3b" })),
	]

	def coms3 = [
		new Command(description : "coms3subTask1", executable: new Executable(closure:  {println "exec 1a" })),
		new Command(description : "coms3subParent1", children : coms5),
		new Command(description : "coms3subTask3", executable: new Executable(closure:  {println "exec 3a" })),
	]

	def coms2 = [
		new Command(description : "coms2subTask1", executable: new Executable(closure:  {println "exec 1a" })),
		new Command(description : "coms2subParent1", children : coms4),
		new Command(description : "coms2subTask3", executable: new Executable(closure:  {println "exec 3a" })),
	]

	def coms = [
		new Command(description : "task1", executable: new Executable(closure:  {println "exec 1" })),
		new Command(description : "parent1", children: coms2),
		new Command(description : "parent2", children: coms3),
		new Command(description : "parent3", children: coms6),
		new Command(description : "task2", executable: new Executable(closure:  {println "exec 2" })),
	]

	public List<Command> getComs(){
		coms
	}
}
